﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Prav.Model
{
    public class Post
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Int64 Id { get; set; }

        public string AuthorUserId { get; set; }

        [ForeignKey("AuthorUserId")]
        public virtual ApplicationUser Author { get; set; }

        public Int64? ParentId { get; set; }

        [ForeignKey("ParentId")]
        public Post Parent { get; set; }

        public virtual List<Post> Comments { get; set; }

        public string Header { get; set; }

        public string Body { get; set; }

        public DateTime CreateTime { get; set; }

        public DateTime LastEditTime { get; set; }

        public bool Approved { get; set; }

        public int AccessLevel { get; set; }
    }
}